<?php

class Home extends CI_Controller {

    var $_public_view;

    function __construct() {
        parent::__construct();
        $this->load->model('model_listing', 'mlisting');
        $this->load->helper(array('url','string'));
        $this->load->library('session','string');
        $this->config->load('artyproperty');
        $this->_public_view = $this->config->item('public_view');
    }

    function index() {
        //ini hanya untuk sementara
        // $this->session->set_userdata('isLogin', true);
        // $this->session->set_userdata('username', 'faiq');
        // $this->session->set_userdata('level', 1);
        // $this->session->set_userdata('user_id', 1);
        // //
        //
        $this->session->set_userdata('page', 1);
        //cek session
        $islogin = $this->session->userdata('isLogin');
        $user = '';
        if ($islogin) {
            $user = $this->session->userdata('username');
        }

        $data = array('page_title' => 'Artyproperty',
            'page_content' => 'home', 'isLogin' => $islogin,
            'user' => $user);

        //unset query search
        //echo "unset session query <br/>";
        $this->session->unset_userdata('search');
        $this->session->unset_userdata('mode');

        $this->load->view('header', $data);
        $this->load->view('home', $data);
        $this->load->view('footer');
    }

}

?>
